package cn.gok.common.dao.goods;

import cn.gok.common.entity.goods.GoodsCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: DxlinY
 * @apiNote:
 * @date: 2020/11/1
 * @time: 16:51
 */
@Repository
public interface GoodsCategoryMapper extends BaseMapper <GoodsCategory> {


    /**
     * 通过parentId获取分类列表
     *
     * @param parentId 父级菜单编号
     * @return list
     */
    @Select("select " +
            "CATEGORY_ID," +
            "CATEGORY_NAME," +
            "PARENT_ID," +
            "CATY_DESC " +
            "from " +
            "g_category " +
            "where " +
            "PARENT_ID = #{parentId}")
    List <GoodsCategory> listByParentId(String parentId);
}
